class JiSuanQi():
    size=20*30
    countKey=30
    isHaveMusize=0
    _name="jisuanqi"
    def __init__(self,n):
        self._name=n
        print("初始化")
    def sum(self,a,b):
        if isinstance(a,(int,float)) and isinstance(b,(int,float)):
            c=a+b
            if isinstance(c,(float)):
                c=round(c,2)
            return c
        elif a=='' or a is None:
            return "第一个不能为空"
        elif b=='' or b is None:
            return "第二个不能为空"
        else:
            return "非法输入"

    def jian(self,a,b):
        if isinstance(a,(int,float)) and isinstance(b,(int,float)):
            c=a-b
            if isinstance(c,(float)):
                c=round(c,2)
            return c
        elif a=='' or a is None:
            return "第一个不能为空"
        elif b=='' or b is None:
            return "第二个不能为空"
        else:
            return "非法输入"
    def cheng(self,a,b):
        if isinstance(a,(int,float)) and isinstance(b,(int,float)):
            c=a*b
            if isinstance(c,(float)):
                c=round(c,2)
            return c
        elif a=='' or a is None:
            return "第一个不能为空"
        elif b=='' or b is None:
            return "第二个不能为空"
        else:
            return "非法输入"
    def chu(self,a,b):
        if b != 0:
            if isinstance(a,(int,float)) and isinstance(b,(int,float)):
                c = a / b
                if isinstance(c,(float)):
                    c=round(c,2)
                return c
            elif a=='' or a is None:
                return "第一个不能为空"
            elif b=='' or b is None:
                return "第二个不能为空"
            else:
                return "非法输入"
        else:
            return "非法输入"
if __name__ == '__main__':
    d=JiSuanQi("jsq")
    print(d.sum(24,12))
    print(d.jian(6.7,4.5))
    print(d.cheng(10,20))
    print(d.chu(20,10))